<template>
  <view class="card">
    <image :src="course.image" class="card-img" mode="aspectFill" />
    <view class="card-content">
		<view class="flex">
			<view class="card-title">{{ course.title }}</view>
			<view class="card-category">{{ course.category }}</view>
		</view>
      <view class="card-info">
		<uni-icons type="person" size="20" class="icontex"></uni-icons>
        <text class="card-date">{{ course.date }}</text>
      </view>
      <view class="card-bottom">
        <text class="card-price">￥{{ course.price }}</text>
        <text v-if="course.hot" class="card-hot">HOT</text>
      </view>
    </view>
  </view>
</template>

<script>
export default {
  props: {
    course: Object
  }
}
</script>

<style scoped>
.card {
  width:700rpx;
  background: #fff;
  border-radius: 20rpx;
  box-shadow: 0 2rpx 8rpx #eee;
  margin-bottom: 30rpx;
  overflow: hidden;
}
.card-img {
  width: 100%;
  height: 180rpx;
  object-fit: cover;
}
.card-content {
  padding: 10rpx 20rpx;
  padding-bottom: 20rpx;
}
.card-title {
  font-size: 32rpx;
  font-weight: bold;
  margin-bottom: 5rpx;
}
.card-category {
  color: #888;
  font-size: 24rpx;
  margin-bottom: 10rpx;
  margin-left: 20rpx;
}
.card-info {
  display: flex;
  align-items: center;
  font-size: 22rpx;
  color: #aaa;
  margin-bottom: 10rpx;
}
.card-date {
  margin-left: 8rpx;
}
.card-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.card-price {
  color: #31b0e5;
  font-size: 30rpx;
  font-weight: bold;
}
.card-hot {
  background: red;
  color: #fff;
  border-radius: 20rpx;
  padding: 2rpx 16rpx;
  font-size: 20rpx;
  margin-left: 10rpx;
}
</style>